/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.jeck.action.cu_loginadmin.bussiness;

import com.jeck.action.cu_loginadmin.data.mg_Login;

import com.jeck.tools.Menu;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author bicho
 */
public class Login {
    List menu;

    public boolean validateAdmin(String user, String pass){
        int id = mg_Login.getIdUser(user, pass);
        if( id > 0){
            setMenu( mg_Login.getMenuByIdUser(id) );         
            return true;
        }
        return false;
    }
    public boolean validateConf(String user, String pass){
        if(mg_Login.getIdUser(user, pass) > 0){
             menu = new ArrayList();
            return true;
        }
        return false;
    }
    public boolean validateUser(String user, String pass){
        if(mg_Login.getIdUser(user, pass) > 0){
             menu = new ArrayList<Menu>();
            return true;
        }
        return false;
    }

    public List getMenu() {
        return menu;
    }

    public void setMenu(List menu) {
        this.menu = menu;
    }

}
